<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<div id="user_reg_regDialog" class="easyui-dialog"  >
    <form id="user_reg_regForm" method="post">
        <table >
            <tr>
                <td> 登陆名 : </td>
                <td><input name="name" value="admin" class="easyui-validatebox" data-options="required:true,missingMessage:'请输入注册名',validType:['text','length[3,10]']"></td>
            </tr>
            <tr>
                <td> 密  码  :</td>
                <td><input name="pwd" value="123456"  class="easyui-validatebox"  type="password" data-options="required:true,validType:['text','length[3,10]']"></td>
            </tr>
            <tr>
                <td> 重复密码: </td>
                <td><input name="rePwd" class="easyui-validatebox"  type="password"  data-options="required:true,validType:['length[3,20]','eqPwd[\'#user_reg_regForm input[name=pwd]\']']"></td><%-- index_regForm input[name='pwd']--%>
            </tr>
        </table>
    </form>
</div>

<script>
    $(function(){
        $("#user_reg_regDialog").dialog({iconCls:'icon-man',modal:true,title:'注册',buttons:[
            {text:'<strong>注册</strong>',iconCls:'icon-ok',handler:reg}]}).dialog("close");
        $("#user_reg_regForm").form({
            url:"${pageContext.request.contextPath}/userAction!regUser.action",
            success:function(data){
                $("#user_reg_regDialog").dialog("close");
                $.messager.show({
                    title:'提示',
                    msg: $.parseJSON(data).msg
                });
            }});
        $("form input").bind("keyup",function(e){
            /*回车提交*/
            if(e.keyCode == '13'){
                var t = this;
                $("#user_reg_regForm").submit();
            }
        });

    });

    function reg(){
        $("#user_reg_regForm").submit();
        //      alert("${pageContext.request.contextPath}/userAction!regUser.action");
    }

    function gotoReg(){
        $("#user_reg_regDialog").dialog("open");
    }
</script>